<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class CreateMedicalDrug
 * 药物表
 */
class CreateMedicalDrug extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('st_medical_medical_drug', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedTinyInteger('type')->comment("药品类别：1西药 2中药");
            $table->string('name')->comment("药品名");
            $table->unsignedTinyInteger('form')->comment("药物剂型：1 片剂 2胶囊剂 3液体剂型 4注射剂型");
            $table->string('specification')->comment("药物规格，例如0.85克");
            $table->unsignedInteger('sort')->comment("药品排序");
            $table->unsignedInteger('add_user')->comment("添加人");
            $table->timestamp('add_time')->comment("添加时间");
            $table->string('direction')->comment("服用方法:例如每日几次，每次几粒");
            $table->unsignedTinyInteger('classify')->comment("药物分类：1 普通药品 2 胰岛素");
            $table->unsignedTinyInteger('drug_type')->comment("用药类型：关联medical_drug_type表中分类");
            $table->string('pic')->comment("药品图片");
            $table->string('remark')->comment("备注");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('st_medical_medical_drug');
    }
}
